
typedef struct{
	unsigned short limit_low;
	unsigned short base_low;
	unsigned char base_middle;
	unsigned char access;
	unsigned char granularity;
	unsigned char base_high;
} __attribute__((packed)) gdt_entry;

typedef struct {
       unsigned short	backlink, __blh;
       unsigned	esp0;
       unsigned short	ss0, __ss0h;
       unsigned	esp1;
       unsigned short	ss1, __ss1h;
       unsigned	esp2;
       unsigned short	ss2, __ss2h;
       unsigned	cr3;
       unsigned	eip;
       unsigned	eflags;
       unsigned	eax, ecx, edx, ebx;
       unsigned	esp, ebp, esi, edi;
       unsigned short	es, __esh;
       unsigned short	cs, __csh;
       unsigned short	ss, __ssh;
       unsigned short	ds, __dsh;
       unsigned short	fs, __fsh;
       unsigned short	gs, __gsh;
       unsigned short	ldt, __ldth;
       unsigned short	trace, bitmap;
} tss_t;

typedef struct{
	unsigned short limit;
	unsigned int base;
} __attribute__((packed)) gdt_ptr;

extern void gdt_flush(gdt_ptr gp);
